<!DOCTYPE html>
<html lang="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="res/push.js"></script>
<link rel="shortcut icon" type="image/ico"
	href="https://www.wuzhaoqi.top/web/favicon.ico">
<meta name="applicable-device" content="pc">
<meta name="mobile-agent"
	content="format=html5;url=https://m.sq688.com/my">
<link rel="alternate" media="only screen and(max-width: 800px)"
	href="https://m.sq688.com/my">
<title>无损分享_无损音乐下载_FLAC_WAV_APE_DSD_SQ688_超高无损音乐</title>
<meta name="keywords" content="无损分享,无损音乐下载,FLAC,WAV,APE,DSD,SQ688超高无损音乐">
<link rel="stylesheet" type="text/css" href="res/main.css">
<link rel="stylesheet" type="text/css" href="res/font-awesome.css">
<script type="text/javascript" src="res/clipboard.js"></script>
<script type="text/javascript" src="js/vue.js"></script>
<script type="text/javascript" src="js/jquery-3.5.1.js"></script>
<script type="text/javascript" src="js/axios.js"></script>
<script type="text/javascript" src="js/Popup.js"></script>
<script type='text/javascript' src='layui/layui.all.js'></script>
<link rel="stylesheet" href="layui/css/layui.css" media="all">
<script type="text/javascript">
        //注意：导航 依赖 element 模块，否则无法进行功能性操作
        layui.use('element', function () {
            var element = layui.element;

            //…
        });
    </script>

</head>
<body>

	<div id="main">
		<div id="header" class="header">
			<div class="warp">
				<div class="logo">
					<h1>超高无损音乐</h1>
				</div>
				<ul class="menu">
					<li><a href="index.html" class="cur">首页</a></li>
					<li><a href="singer.html#华语男歌手">华语男歌手</a></li>
					<li><a href="singer.html#华语女歌手">华语女歌手</a></li>
					<li><a href="singer.html#华语乐队">华语乐队</a></li>
					<li><a href="singer.html#欧美歌手">欧美歌手</a></li>
					<li><a href="singer.html#日韩歌手">日韩歌手</a></li>
					<li><a href="singer.html#专辑合集">专辑合集</a></li>
					<li><a href="share.html">网友分享</a></li>

				</ul>
				<div class="users">
                <div>
                    <ul class="layui-nav">
                        <li class="layui-nav-item">
                            <a href=""><img :src="user.head" class="layui-nav-img"></a>
                            <dl class="layui-nav-child">
                                <dd><a href="member.html" style="color: #0C0C0C">个人中心</a></dd>
                                <dd><a href="javascript:;" style="color: #0C0C0C">修改密码</a></dd>
                                <dd><a href="vip.html" style="color: #0C0C0C">会员中心</a></dd>
                                <dd><a onclick="returnLogin()" style="color: #0C0C0C">退出登录</a></dd>
                            </dl>
                        </li>
                    </ul>
                </div>
            </div>
				<div class="clear"></div>
			</div>
			<div class="search-bar">
				<div class="bar">
					<div class="wrp">

						<div class="clear"></div>
					</div>
				</div>
			</div>
		</div>

		<div id="member" class="member">
			<div class="m-left">
				<div class="top">
					<div class="avt">
						<img :src="user.head" alt="">
					</div>
					<div class="info">
						<h4 v-text="user.nickname"></h4>
						<p>
							<span class="tag">标品</span>
						</p>
					</div>
					<div class="cer">
						<ul class="menu">
							<li><a href="member.html"><i class="fa fa-navicon"></i>
									用户中心</a></li>
							<li><a href="setting.html"><i class="fa fa-user"></i>
									个人信息</a></li>
							<li><a href="my.html" class="cur"><i class="fa fa-music"></i>
									无损分享</a></li>
							<li><a href="cs.html"><i class="fa fa-star"></i> 音乐收藏</a></li>
						</ul>
					</div>
				</div>
			</div>
			<div class="m-right">
				<div class="cts">
					<div class="add">
						<button class="btn-save"
							onclick="function gotoShare() {
                       window.location.href = 'myshares.html';
                    }
                    gotoShare()">分享音乐
						</button>
					</div>
					<table class="shr" id="list">
						<tbody>
							<tr>
								<th>标题</th>
								<th>歌手名</th>
								<th>发布时间</th>
								<th>热度</th>
								<th>操作</th>
							</tr>
							<tr v-for="share in shares">
								<td v-text="share.name"></td>
								<td v-text="share.singers"></td>
								<td v-text="share.create_time"></td>
								<td v-text="share.heat"></td>
								<td>
									<div class="layui-btn-group">
										<button type="button" class="layui-btn layui-btn-sm"
											:value="share.name + '#'+ share.singers"
											onclick="lookShare(this.value)">
											<i class="layui-icon">&#xe615;</i>
										</button>
										<button type="button" lay-event="edit"
											class="layui-btn layui-btn-sm" :value="share.name"
											onclick="changeShare(this.value)">
											<i class="layui-icon">&#xe642;</i>
										</button>
										<button type="button" class="layui-btn layui-btn-sm"
											:value="share.id" onclick="deleteShare(this.value)">
											<i class="layui-icon">&#xe640;</i>
										</button>
									</div>
								</td>
							</tr>
						</tbody>
					</table>
					<div class="mypage">
						<a class="back" @click="last_page">上一页</a> <span class="total"
							v-text="page">1/1</span> <a class="next" @click="next_page">下一页</a>
					</div>
				</div>
			</div>

		</div>
		<div style="text-align: center; clear: both; margin-top: 250px">

		</div>

		<div class="footer">
			<div class="warp">
				Copyright 2015-2020 超高无损音乐<br> <a
					href="https://beian.miit.gov.cn/#/Integrated/index"> <span>湘ICP备2020019542号-1</span></a><br>
			</div>
		</div>

	</div>


	<script type="text/javascript">
    function lookShare(data) {
        console.log(data)
        window.location.href = "share_item.html" + "?name=" + data;
    }

    function deleteShare(data) {
        const url = "user.do?op=deleteShear&id=" + data;
        layer.confirm('您真的要删除这首歌曲吗？', {
            icon: 0,
            skin: 'layui-layer-lan',
            btn: ['确认', '取消'] //按钮
        }, function (index) {
            layer.close(index);
            axios.get(url).then((res) => {
                alertMy(res.data);
                na.queryShareDelete();
            });

            console.log("===")
        }, function () {
            layer.close()
        });

    }

    function changeShare(data) {
        alertMy('等下写')

    }

    const na = new Vue({
            el: "#main",
            data: {
                shares: [],
                user: {
                    id: 0,
                    name: "",
                    nickname: "",
                    pwd: "",
                    phone: "",
                    email: "",
                    qq: "",
                    head: "",
                    rank: "",
                    glod: "",
                    create_time: "",
                    vipTime: ""
                },
                page: 1, //当前页数
                pages: 0, //总数据数
                pageNums: 10, //一页的数据数
                pageMax: 0, //最大页数
                isVip: false,
            },
            created() {
                this.query();
                this.queryShare();

            },
            methods: {
                //上一页
                last_page() {
                    this.page -= 1;
                    if (this.page <= 0) {
                        alertMy("别点了到顶了！")
                        this.page = 0;
                        return;
                    }

                    this.queryShare();
                },
                //下一页
                next_page() {
                    this.page += 1;
                    if (this.page > this.pageMax) {
                        alertMy("别点了到底了！");
                        this.page = this.pageMax;
                        return;
                    }
                    this.queryShare();


                },
                query() {
                    const url1 = "user.do?op=queryUser";
                    axios.get(url1).then((res) => {
                        if (res.data === "请先登录 !") {
                            gotoLogin();
                        }
                        this.user = res.data;
                    });

                    const url2 = "user.do?op=querySharePages";
                    axios.get(url2).then((res) => {
                        if (res.data === "请先登录 !") {
                            gotoLogin();
                        }
                        this.pages = res.data;
                        //计算分页总数
                        if (this.pages % this.pageNums === 0) {
                            this.pageMax = this.pages / this.pageNums;
                        } else {
                            this.pageMax = this.pages / this.pageNums + 1;
                        }
                    });

                    axios.get("user.do?op=isVip").then((res) => {
                        if (res.data === "0") {
                            this.isVip = true;
                        } else {
                            alertMyVip()
                        }
                    });


                },
                queryShare() {
                    const url2 = "user.do?op=queryShare";
                    axios.get(url2, {
                        params: {
                            page: this.page,
                            pageNums: this.pageNums
                        }
                    }).then((res) => {
                        this.shares = res.data;
                    });

                    for (var i = 0; i < this.shares.length; i++) {
                        console.log("==== " + this.shares[i])
                    }
                },
                queryShareDelete() {
                    const url1 = "user.do?op=querySharePages";
                    axios.get(url1).then((res) => {
                        if (res.data === "请先登录 !") {
                            gotoLogin();
                        }
                        this.pages = res.data;
                        //计算分页总数
                        if (this.pages % this.pageNums === 0) {

                            this.pageMax = this.pages / this.pageNums;
                        } else {
                            this.pageMax = this.pages / this.pageNums + 1;
                        }
                    });
                    const url2 = "user.do?op=queryShare";
                    axios.get(url2, {
                        params: {
                            page: this.page,
                            pageNums: this.pageNums
                        }
                    }).then((res) => {
                        this.shares = res.data;
                    });
                }

            }

        })
    ;
</script>
</body>

</html>